package edu.terapia.model;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the identity_object_credential_type database table.
 * 
 */
@Entity
@Table(name="identity_object_credential_type")
public class IdentityObjectCredentialType implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private int id;

	private String name;

	//bi-directional many-to-one association to IdentityObjectCredential
	@OneToMany(mappedBy="identityObjectCredentialType")
	private List<IdentityObjectCredential> identityObjectCredentials;

	public IdentityObjectCredentialType() {
	}

	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public List<IdentityObjectCredential> getIdentityObjectCredentials() {
		return this.identityObjectCredentials;
	}

	public void setIdentityObjectCredentials(List<IdentityObjectCredential> identityObjectCredentials) {
		this.identityObjectCredentials = identityObjectCredentials;
	}

	public IdentityObjectCredential addIdentityObjectCredential(IdentityObjectCredential identityObjectCredential) {
		getIdentityObjectCredentials().add(identityObjectCredential);
		identityObjectCredential.setIdentityObjectCredentialType(this);

		return identityObjectCredential;
	}

	public IdentityObjectCredential removeIdentityObjectCredential(IdentityObjectCredential identityObjectCredential) {
		getIdentityObjectCredentials().remove(identityObjectCredential);
		identityObjectCredential.setIdentityObjectCredentialType(null);

		return identityObjectCredential;
	}

}